<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditContratoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditContratoLabel_idContrato}" for="idContrato" />
                    <h:inputText id="idContrato" value="#{contratoController.selected.idContrato}" title="#{bundle.EditContratoTitle_idContrato}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_idContrato}"/>
                    <h:outputLabel value="#{bundle.EditContratoLabel_tempo}" for="tempo" />
                    <h:inputText id="tempo" value="#{contratoController.selected.tempo}" title="#{bundle.EditContratoTitle_tempo}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_tempo}"/>
                    <h:outputLabel value="#{bundle.EditContratoLabel_detalhes}" for="detalhes" />
                    <h:inputText id="detalhes" value="#{contratoController.selected.detalhes}" title="#{bundle.EditContratoTitle_detalhes}" />
                    <h:outputLabel value="#{bundle.EditContratoLabel_fkUsuario}" for="fkUsuario" />
                    <h:selectOneMenu id="fkUsuario" value="#{contratoController.selected.fkUsuario}" title="#{bundle.EditContratoTitle_fkUsuario}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_fkUsuario}">
                        <f:selectItems value="#{usuarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditContratoLabel_fkDepartamento}" for="fkDepartamento" />
                    <h:selectOneMenu id="fkDepartamento" value="#{contratoController.selected.fkDepartamento}" title="#{bundle.EditContratoTitle_fkDepartamento}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_fkDepartamento}">
                        <f:selectItems value="#{departamentoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditContratoLabel_fkFuncionario}" for="fkFuncionario" />
                    <h:selectOneMenu id="fkFuncionario" value="#{contratoController.selected.fkFuncionario}" title="#{bundle.EditContratoTitle_fkFuncionario}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_fkFuncionario}">
                        <f:selectItems value="#{funcionarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditContratoLabel_data}" for="data" />
                    <h:inputText id="data" value="#{contratoController.selected.data}" title="#{bundle.EditContratoTitle_data}" required="true" requiredMessage="#{bundle.EditContratoRequiredMessage_data}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                </h:panelGrid>
                <h:commandLink action="#{contratoController.update}" value="#{bundle.EditContratoSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditContratoViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{contratoController.prepareList}" value="#{bundle.EditContratoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditContratoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
